﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Tools
{
    public partial class UrlCode : Base
    {
        public UrlCode()
        {
            InitializeComponent();
            base.SetDefaultLocation();

            comboBox1.SelectedIndex = 0;
        }

        private void btn_Encode_Click(object sender, EventArgs e)//解码
        {
            txt_Decode.Text = System.Web.HttpUtility.UrlDecode(txt_Encode.Text, System.Text.Encoding.GetEncoding(comboBox1.Text));
        }

        private void btn_Decode_Click(object sender, EventArgs e)//编码
        {
            txt_Encode.Text = System.Web.HttpUtility.UrlEncode(txt_Decode.Text, System.Text.Encoding.GetEncoding(comboBox1.Text));
        }
    }
}
